/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.manager;

import br.com.deployment.entidade.protocolo.Protocolo;
import br.com.deployment.servico.ProtocoloServico;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author roniere
 */
@ManagedBean
@ViewScoped
public class ManagerIndexProtocolo implements Serializable{
    
    @EJB
    ProtocoloServico protocoloServico;
    
    private List<Protocolo> protocolosRec;
    private List<Protocolo> protocolosPendentes;
    private List<Protocolo> protocolosFinal;

    
    @PostConstruct
    public void init(){
        System.err.println("XXXXXXXXXXXXX"); 
         protocolosRec = new ArrayList<Protocolo>();
         protocolosPendentes = new ArrayList<Protocolo>();
         protocolosFinal = new ArrayList<Protocolo>();
         poll();
    }
    
    public void poll(){
        protocolosRec = protocoloServico.recentes();
        protocolosPendentes = protocoloServico.pendentes();
        protocolosFinal = protocoloServico.finalizados();
    }

    public List<Protocolo> getProtocolosFinal() {
        return protocolosFinal;
    }

    public void setProtocolosFinal(List<Protocolo> protocolosFinal) {
        this.protocolosFinal = protocolosFinal;
    }
    
    

    public List<Protocolo> getProtocolosPendentes() {
        return protocolosPendentes;
    }

    public void setProtocolosPendentes(List<Protocolo> protocolosPendentes) {
        this.protocolosPendentes = protocolosPendentes;
    }

    public List<Protocolo> getProtocolosRec() {
        return protocolosRec;
    }

    public void setProtocolosRec(List<Protocolo> protocolosRec) {
        this.protocolosRec = protocolosRec;
    }
  
    
}
